<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8" %>
<%String path = request.getContextPath();%>
<%@ taglib uri="/WEB-INF/tld/c.tld" prefix="c" %>
<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <title>资管客户还款记录表 管理</title>
    <style type="text/css">
        .searchArea .fieldBox .label{width: 80px; overflow: hidden; white-space: nowrap; text-overflow: ellipsis;}
    </style>
    <jsp:include page="../../import.jsp" flush="true"/>
</head>

<body class="iframeBody">
<div class="Wrapper">
    <div class="searchArea">
        <form id="searchBar">
            <div class="fieldset1 clearFix">
                <div class="fieldBox">
                    <div class="label">资方支付表号</div>
                    <div class="field">
                        <input name="paySchNo" id="paySchNo" type="text" class="ui-textbox" value="">
                    </div>
                </div>
                <div class="fieldBox">
                    <div class="label">第三方机构</div>
                    <div class="field">
                        <input name="insCode" id="insCode" data-value="" placeholder="请选择" ltype="combobox">
                    </div>
                </div>
                <div class="fieldBox">
                    <div class="label">还款方式</div>
                    <div class="field">
                        <select name="action" id="action">
                            <option value="platformCompensatory" selected>贷款还款</option>
                            <option value="prepayment">提前还款</option>
                        </select>
                    </div>
                </div>
                 <div class="formBtns notRight">
                    <span id="searchBtn" class="sq-button sq-button-hasicon"><i class="sqBtnIco_1"></i>查询</span>
                    <span id="clearBtn" class="sq-button sq-button-hasicon"><i class="sqBtnIco_19"></i>清空</span>
                    <input id="resetBtn" type="reset" value="重置" class="l-button l-button-reset Hide"/>
                </div>
            </div>
        </form>
    </div>
    <div id="ligergrid1" class="sq-grid"></div>
</div>

<script type="text/javascript">
    var grid = null, menu = null;
    $(function () {
        grid = $("#ligergrid1").ligerGrid({
            url: '<%=path%>/repay/insCstRepaySettle/initRepayLogList.do',
            method: 'get',
            columns: [
                { display: '合同号', name: 'lsCntNo', minWidth: 150 ,align:'left'},
                { display: '支付表号', name: 'paySchNo', minWidth: 200,align:'left',},
                { display: '承租人名称', name: 'cstNm', minWidth: 80,align:'left'},
                { display: '第三方机构', name: 'insNm', minWidth: 80,align:'left'},
                { display: '起租日', name: 'lsDt', minWidth: 80,align:'left',render:renderDate},
                { display: '状态', name: 'status', minWidth: 80,align:'left',render:renderDate},
            ],
            pageSize: 10,
            root: 'rows',
            record: 'total',
            hideLoadButton: true,
            width: '100%',
            height: '100%',
            heightDiff: -2,
            checkbox: true,
            rownumbers: true,
            allowUnSelectRow: true,
            alternatingRow: false
        });
        grid.setHeight(100);

        $("#searchBar").ligerForm();

        $("#pageloading").hide();

        /* 查询 */
        $("#searchBtn").click(function (event) {
            var form = liger.get("searchBar");
            var data = form.getData();
            for (name in data) {
                grid.setParm(name, data[name]);
            }
            grid.reload();
        });

        /* 清空 */
        $("#clearBtn").click(function (event) {
            clearLigerForm("searchBar");
        });

        var callback = function () {
            grid.reload();
        };

        $("#insCode").ligerComboBox({
            valueField: 'key',
            textField: 'value'
        });
        liger.get("insCode").setData(${insCdList});
    });

    //格式化时间
    function renderDate(rowdata, index, value) {
        var dateStr = "";
        if (null != value) {
            var date = new Date(value);
            dateStr = DateUtils.formatDate(date, DateUtils.YYYY_MM_DD);
        }
        return dateStr;
    }
</script>

</body>
</html>
